libname data "C:\Documents and Settings\ejohnson\My Documents\MultilevelModels"; proc contents data=data.asian; run; data data; set data.asian; age2 = age*age; girl = gender -1; run; * Quadratic growth with random intercept; proc mixed data=data; class id; model weight = age age2 / solution; random intercept / subject=id; run; * Quadratic growth curve model with random intercept and slope; proc mixed data=data; class id; model weight = age age2 / solution; random intercept age / subject=id type=un; *NOTE: this create two random effects, one for the intercept; * and one for age. type=un option say fit this bivariate vector; * of random effects as a normal model with mean 0 and var/cov matrix; * var(intercept), cov(intercept,age), var(age); * The variance components are listed in this order in the output; run; * Quadratic growth curve model with random intercept and slope; * and child specific predictor; proc mixed data=data; class id; model weight = age age2 girl / solution; random intercept age / subject=id type=un; run; * Now add additional commands to get the empirical bayes estimates; * The outp option in the model statement will save the empirical bayes; * estimates along with the original data into a dataset called "ebayes"; proc mixed data=data; class id; model weight = age age2 girl / solution outp=ebayes; random intercept age / subject=id type=un; run;